/**
 * Created by wangzilong on 2017/4/11.
 */
import React, { Component } from 'react';
import {
    AppRegistry,
    StyleSheet,
    Text,
    View,
    Image,
    ScrollView,
    TouchableOpacity,
    TextInput,
    ListView,
    Modal,
    Platform
} from 'react-native';
import ImageWrapper from '../components/ImageWrapper';
import NavigationBar from '../components/NavigationBar';
var Dimensions = require('Dimensions');
import ImageCropPicker from 'react-native-image-crop-picker';
const { width, height } = Dimensions.get('window');

export default class Monitor extends Component{
    constructor(props) {
        super(props);
        this.state = {
            aa:null
        };
        
    }
    render(){
        return (
            <View style={styles.container}>
                <NavigationBar 
                    leftIcon={'left'} 
                    titleText={'监控管理'} 
                    leftPress={()=>this.goBack()}/>
            <TouchableOpacity onPress={()=>this.qqq()}>
                <Text>qwer</Text>
            </TouchableOpacity>  
             <TouchableOpacity style={{marginTop:30}} onPress={()=>this.www()}>
                <Text>666</Text>
            </TouchableOpacity>  
            </View>
        )

    }

    goBack(){
        this.props.navigation.goBack();
    }
    qqq(){
        var $this = this;
        ImageCropPicker.openPicker({
              multiple: true,
              maxFiles:4
          }).then(images => {
              alert(JSON.stringify(images))
              $this.setState({
                aa:images
              })
          });
        // ImageCropPicker.openPicker({
        //       width: 300, 
        //       height: 300, 
        //       cropping: true
        //    }).then(image => { 
        //       $this.setState({
        //         aa:image
        //       })
        //    });
    }
    www(){
        alert(JSON.stringify(this.state.aa))
    }

}


const styles = StyleSheet.create({
    container:{
        flex:1,
        backgroundColor:'#fff',
        ...Platform.select({
            ios: {
                marginTop: 20
            },
            android: {
                marginTop:0
            },

        }),
    }, 
    
    
});